package org.example.erp.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.Getter;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 
 * @TableName repair_orders
 */
@TableName(value ="repair_orders")
@Data
public class RepairOrders implements Serializable {
    /**
     *  维修单编号，主键不自增


     */
    private String repairNo;

    /**
     * 维修单名称
     */
    private String repairName;

    /**
     * 设备编码
     */
    private String deviceId;

    /**
     * 报修日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date repairTime;

    /**
     * 维修完成日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date completionDate;

    /**
     * 验收日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date acceptanceDate;

    /**
     * 维修结果（0报废，1维修成功）
     */
    private String repairResults;

    /**
     * 维修人员
     */
    private String repairPersonnel;

    /**
     * 验收人员
     */
    private String acceptancePersonnel;

    /**
     * 单据状态
     */
    private String documentStatus;

    /**
     * 备注
     */
    private String remark;

    /**
     * 备用列1
     */
    private String columnOne;

    /**
     * 备用列2
     */
    private String columeTwo;

    /**
     * 备用列3
     */
    private String columeThree;


    @TableField(exist = false)
    private Equipment equipment;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        RepairOrders other = (RepairOrders) that;
        return (this.getRepairNo() == null ? other.getRepairNo() == null : this.getRepairNo().equals(other.getRepairNo()))
            && (this.getRepairName() == null ? other.getRepairName() == null : this.getRepairName().equals(other.getRepairName()))
            && (this.getDeviceId() == null ? other.getDeviceId() == null : this.getDeviceId().equals(other.getDeviceId()))
            && (this.getRepairTime() == null ? other.getRepairTime() == null : this.getRepairTime().equals(other.getRepairTime()))
            && (this.getCompletionDate() == null ? other.getCompletionDate() == null : this.getCompletionDate().equals(other.getCompletionDate()))
            && (this.getAcceptanceDate() == null ? other.getAcceptanceDate() == null : this.getAcceptanceDate().equals(other.getAcceptanceDate()))
            && (this.getRepairResults() == null ? other.getRepairResults() == null : this.getRepairResults().equals(other.getRepairResults()))
            && (this.getRepairPersonnel() == null ? other.getRepairPersonnel() == null : this.getRepairPersonnel().equals(other.getRepairPersonnel()))
            && (this.getAcceptancePersonnel() == null ? other.getAcceptancePersonnel() == null : this.getAcceptancePersonnel().equals(other.getAcceptancePersonnel()))
            && (this.getDocumentStatus() == null ? other.getDocumentStatus() == null : this.getDocumentStatus().equals(other.getDocumentStatus()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getColumnOne() == null ? other.getColumnOne() == null : this.getColumnOne().equals(other.getColumnOne()))
            && (this.getColumeTwo() == null ? other.getColumeTwo() == null : this.getColumeTwo().equals(other.getColumeTwo()))
            && (this.getColumeThree() == null ? other.getColumeThree() == null : this.getColumeThree().equals(other.getColumeThree()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getRepairNo() == null) ? 0 : getRepairNo().hashCode());
        result = prime * result + ((getRepairName() == null) ? 0 : getRepairName().hashCode());
        result = prime * result + ((getDeviceId() == null) ? 0 : getDeviceId().hashCode());
        result = prime * result + ((getRepairTime() == null) ? 0 : getRepairTime().hashCode());
        result = prime * result + ((getCompletionDate() == null) ? 0 : getCompletionDate().hashCode());
        result = prime * result + ((getAcceptanceDate() == null) ? 0 : getAcceptanceDate().hashCode());
        result = prime * result + ((getRepairResults() == null) ? 0 : getRepairResults().hashCode());
        result = prime * result + ((getRepairPersonnel() == null) ? 0 : getRepairPersonnel().hashCode());
        result = prime * result + ((getAcceptancePersonnel() == null) ? 0 : getAcceptancePersonnel().hashCode());
        result = prime * result + ((getDocumentStatus() == null) ? 0 : getDocumentStatus().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getColumnOne() == null) ? 0 : getColumnOne().hashCode());
        result = prime * result + ((getColumeTwo() == null) ? 0 : getColumeTwo().hashCode());
        result = prime * result + ((getColumeThree() == null) ? 0 : getColumeThree().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", repairNo=").append(repairNo);
        sb.append(", repairName=").append(repairName);
        sb.append(", deviceId=").append(deviceId);
        sb.append(", repairTime=").append(repairTime);
        sb.append(", completionDate=").append(completionDate);
        sb.append(", acceptanceDate=").append(acceptanceDate);
        sb.append(", repairResults=").append(repairResults);
        sb.append(", repairPersonnel=").append(repairPersonnel);
        sb.append(", acceptancePersonnel=").append(acceptancePersonnel);
        sb.append(", documentStatus=").append(documentStatus);
        sb.append(", remark=").append(remark);
        sb.append(", columnOne=").append(columnOne);
        sb.append(", columeTwo=").append(columeTwo);
        sb.append(", columeThree=").append(columeThree);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}